const thenFs = require('then-fs')
const path = require('path')

thenFs.readFile(path.join(__dirname, './files/a.txt'), 'utf8')
  .then(data => {
    console.log('成功！')
    console.log(data)
  })
  .catch(err => {
    console.log('失败！')
    console.log(err)
  })

thenFs.writeFile(path.join(__dirname, './files/c.txt'), 'xxxxxxxxxx', 'utf8')
  .then(() => {
    console.log('成功！')
  })
  .catch(err => {
    console.log('失败！')
    console.log(err.message)
  })